<h1>Listing items</h1>
<p>
	<%= link_to 'New item', new_item_path %>
</p>
<table>
  <tr>
    <th>Brand</th>
    <th>Name</th>
    <th>Measure</th>
	<th>Action</th>
  </tr>

<% for item in @items %>
  <tr class="<%= cycle("even", "odd") %>">
    <td><%=h item.brand.name rescue nil %> </td>
    <td><%=h item.name %></td>
    <td><%=h item.measure.unit %></td>
    <td>
    	<%= link_to image_tag("view.gif"), item %>
		<%= link_to image_tag("edit.gif"), edit_item_path(item) %>
		<%= link_to image_tag("delete.gif"), item, :confirm => 'Are you sure?', :method => :delete %>
	</td>
  </tr>
<% end %>
</table>